package ynu.edu.feign;

import org.springframework.stereotype.Component;
import ynu.edu.entities.BaseResponse;

import java.util.HashMap;
import java.util.Map;

/**
 * 商户服务Feign客户端降级实现
 */
@Component
public class MerchantFeignClientFallback implements MerchantFeignClient {

    @Override
    public BaseResponse<Map<String, Object>> getMerchantById(Integer businessId) {
        Map<String, Object> fallbackData = new HashMap<>();
        fallbackData.put("businessId", businessId);
        fallbackData.put("businessName", "暂无商家信息");
        fallbackData.put("businessAddress", "暂无地址信息");
        fallbackData.put("businessExplain", "暂无商家说明");
        return BaseResponse.error(500, "获取商家信息失败，服务不可用");
    }
} 